package com.oazon.system.handler;

import com.moco.launcher.play.MediaController;
import com.oazon.moco.link.core.LinkEventController;
import com.oazon.moco.link.core.LinkSDK;
import com.oazon.system.SysActionChannal;
import com.oazon.system.action.ScreenProtectAction;
import com.oazon.system.core.IActionMessage;
import com.oazon.system.core.IActionhandler;

public class NormalHandler implements IActionhandler {
	
	public NormalHandler() {
	}

	/**
	 * 进入正常状态.重新开始计时，5分钟无操作进入屏保
	 */
	@Override
	public void getIn(IActionMessage actionMessage) {
		LinkSDK.getInstance().isNormal(LinkEventController.systemEventSource);
	}

	@Override
	public void getOut() {
		SysActionChannal.getInstance().doAction(new ScreenProtectAction());	
	}
	
	@Override
	public long getTimeOut(){
		int timeout = 0;
		if(MediaController.getInstance().isPlaying()){
			timeout = NORMAL_TIME_COUNT;
		}else{
			timeout = PAUSE_TIME_COUNT;
		}
		return timeout;
	}

	@Override
	public boolean isPauseTimer() {
		return false;
	}

}
